
function insertBeforeSelected()
{
	
	var x = document.getElementById("hora");
	while (x.options.length > 0) {
		x.remove(0);
	}
	var option = document.createElement("option");
	var iaux;
	var jaux;
	var diaData = document.getElementById("data").value;
	var dataAtual = new Date();
	var mes = dataAtual.getMonth()+1;
	var dia = dataAtual.getDate();
	if(mes<10) {
		mes="0"+mes;
	}
	if(dia<10){
		dia ="0"+dia;
	}
	var diaAtual = dataAtual.getFullYear()+"-"+mes+"-"+dia;

	if(diaData==diaAtual){
	for( var i=dataAtual.getHours(); i<=23; i++) {
    	for( var j=dataAtual.getMinutes();j<=59;j++){
    		option = document.createElement("option");
    		iaux = i;
    		jaux = j;
    		if (i < 10) {
       		 iaux ="0"+i;
       		  }
       		if (j < 10) {
          	 jaux ="0"+j;
          		  }
    		option.text = iaux+":"+jaux;
		   	option.value = iaux+":"+jaux;
		   	x.add(option);
    	}
	}
}
	else{
		for( var i=0; i<=23; i++) {
	    	for( var j=0;j<=45; j=j+15){
	    		option = document.createElement("option");
	    		iaux = i;
	    		jaux = j;
	    		if (i < 10) {
	       		 iaux ="0"+i;
	       		  }
	       		if (j < 10) {
	          	 jaux ="0"+j;
	          		  }
	    		option.text = iaux+":"+jaux;
			   	option.value = iaux+":"+jaux;
			   	x.add(option);
	    	}
		}
	}
}

function myfunc(){
	var x = document.getElementById("data");
	var data = new Date();
	var mes = data.getMonth()+1;
	var dia = data.getDate();
	if(mes<10) {
		mes="0"+mes;
	}
	if(dia<10){
		dia ="0"+dia;
	}
	x.min=data.getFullYear()+"-"+mes+"-"+dia;

}